package com.ruoyi.project.roadnet.baseBridge.service;

import java.util.List;

import com.ruoyi.framework.aspectj.lang.annotation.DataScope;
import com.ruoyi.framework.aspectj.lang.annotation.DataSource;
import com.ruoyi.framework.aspectj.lang.enums.DataSourceType;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.project.roadnet.baseBridge.mapper.BaseBridgeMapper;
import com.ruoyi.project.roadnet.baseBridge.domain.BaseBridge;
import com.ruoyi.project.roadnet.baseBridge.service.IBaseBridgeService;
import com.ruoyi.common.utils.text.Convert;

/**
 * 桥梁 服务层实现
 * 
 * @author zhangdachen
 * @date 2019-04-16
 */
@Service
public class BaseBridgeServiceImpl implements IBaseBridgeService 
{
	@Autowired
	private BaseBridgeMapper baseBridgeMapper;

	/**
     * 查询桥梁信息
     * 
     * @param id 桥梁ID
     * @return 桥梁信息
     */
    @Override
	public BaseBridge selectBaseBridgeById(Integer id)
	{
	    return baseBridgeMapper.selectBaseBridgeById(id);
	}
	
	/**
     * 查询桥梁列表
     * 
     * @param baseBridge 桥梁信息
     * @return 桥梁集合
     */
	@Override
	@DataScope(tableAlias = "road_bridge")
	public List<BaseBridge> selectBaseBridgeList(BaseBridge baseBridge)
	{
	    return baseBridgeMapper.selectBaseBridgeList(baseBridge);
	}
	
    /**
     * 新增桥梁
     * 
     * @param baseBridge 桥梁信息
     * @return 结果
     */
	@Override
	public int insertBaseBridge(BaseBridge baseBridge)
	{
	    return baseBridgeMapper.insertBaseBridge(baseBridge);
	}
	
	/**
     * 修改桥梁
     * 
     * @param baseBridge 桥梁信息
     * @return 结果
     */
	@Override
	public int updateBaseBridge(BaseBridge baseBridge)
	{
	    return baseBridgeMapper.updateBaseBridge(baseBridge);
	}

	/**
     * 删除桥梁对象
     * 
     * @param ids 需要删除的数据ID
     * @return 结果
     */
	@Override
	public int deleteBaseBridgeByIds(String ids)
	{
		return baseBridgeMapper.deleteBaseBridgeByIds(Convert.toStrArray(ids));
	}
	
}
